<template>
  <div class="container">
    <div v-for="(item,index) in colors"
    :key="index"
    :style="{background:item}"
    @click="onClick(item)"
    class="div"></div>
  </div>
</template>

<script>
export default {
  data(){
    return{
      colors:["red","yellow","pink","blue","black"]
    }
  },
  methods:{
    onClick(item){
      this.$emit("colorChange",item)
    }
  }
}
</script>

<style scoped>
.container
{
  width: 100%;
  height: 90px;
  display: inline-flex;
  justify-content: space-around;
  align-items: center;
}

.div
{
  width:50px;
  height:50px;
  border-radius:40px;
}
</style>